package com.leapp.sk.ui.adapter

import android.content.Context
import com.example.mvp.adapter.BaseLibMultipleViewAdapter
import com.example.mvp.binder.BaseDataBinder
import com.example.mvp.delegate.BaseAdapterDelegate
import com.leapp.sk.bean.JoinClassExaminationEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.viewdelegate.adapter.examination.JoinClassExaminationAdapterDelegate

/**
 * 班级审核适配器
 * @author  chaohaipeng  on 2018/8/14.
 */
class JoinClassExaminationAdapter  (context: Context, mlist: List<JoinClassExaminationEntity>,isNoPassed:Boolean) : BaseLibMultipleViewAdapter<JoinClassExaminationEntity>(context, mlist){
    /**
     * 数据
     */
    val mList = mlist
    /**
     * 上下文
     */
    val mContext = context

    val isNoPasseds=isNoPassed
    override fun bindEvenListener(viewDelegate: BaseAdapterDelegate?, position: Int) {
    }

    override fun notifyView(viewDelegate: BaseAdapterDelegate?, position: Int) {
        if (viewDelegate is JoinClassExaminationAdapterDelegate){
            viewDelegate.initData(isNoPasseds)
        }
    }

    override fun getDelegate(position: Int): BaseAdapterDelegate {

        return JoinClassExaminationAdapterDelegate::class.java?.newInstance()

    }

    override fun getDataBinder(position: Int): BaseDataBinder<*, *> {
        return BaseBinder()
    }

    override fun getItemData(position: Int): Any {
        return mList.get(position)
    }
}